package com.baidu.process.config.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baidu.process.config.bean.OptAnswer;
import com.baidu.process.config.mapper.OptAnswerMapper;
import com.baidu.process.config.service.OptAnswerService;
import com.baidu.process.record.mapper.RecordMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author:fangyuchao
 * @Description:
 * @Date: Create in 14:44 2023/2/6
 */
@Service
public class OptAnswerServiceImpl implements OptAnswerService {
    @Resource
    private OptAnswerMapper optAnswerMapper;
    @Override
    public String getAnswerByEvent(String event) {
        LambdaQueryWrapper<OptAnswer> qw = new LambdaQueryWrapper<>();
        qw.eq(OptAnswer::getEvent,event);
        OptAnswer  oa = optAnswerMapper.selectOne(qw);
        return oa.getAnswerText();
    }

}
